extends VBoxContainer
@export var setting_name:String = '基础设置'
@export var setting_items:Array[SettingItemData]
@onready var settingItemScene = preload("res://components/simple_setting_item.tscn")
@onready var settingItemContainer  = %settingItemContainer
@onready var seperator = preload('res://components/h_separator.tscn')

@onready var setting_group_name: Label = %SettingGroupName


# Called when the node enters the scene tree for the first time.
func _ready():
	init_setting_items_scene()

func init_setting_items_scene():
	setting_group_name.text = setting_name
	for i in range(setting_items.size()):
		var settingItemData = setting_items[i]
		var itemScene = settingItemScene.instantiate()
		itemScene.settingItemData = settingItemData
		settingItemContainer.add_child(itemScene)
		
		if i< setting_items.size()-1:
			settingItemContainer.add_child(seperator.instantiate())

